<?php
/*
+--------------------------------------------------------------------------
|   Anwsion [#RELEASE_VERSION#]
|   ========================================
|   by Tatfook Network Team
|   (c) 2011 - 2012 Anwsion Software
|   http://www.anwsion.com
|   ========================================
|   Support: zhengqiang@gmail.com
|   
+---------------------------------------------------------------------------
*/

class upgrade_class extends AWS_MODEL
{
	public function run_query($sql_query)
	{
		$sql_query = str_replace("\n", "\r", $sql_query);
		
		if ($db_table_querys = explode(";\r", str_replace('[#DB_PREFIX#]', AWS_APP::config()->get('database')->prefix, $sql_query)))
		{
			foreach ($db_table_querys as $_sql)
			{
				if ($query_string = trim(str_replace(array(
					"\r", 
					"\n", 
					"\t"
				), '', $_sql)))
				{
					$this->query($query_string);
				}
			}
		}
		return true;
	}
}